/***************************************************************************\
 * Copyright (C) by Keio University
 * Windows.hpp created in 02 2013.
 * Mail : fdesorbi@hvrl.ics.keio.ac.jp
 *
 * Windows.hpp is part of the HVRL Engine Library.
 *
 * The HVRL Engine Library is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (at your option) any later version.
 *
 * The HVRL Engine Library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 \***************************************************************************/

#ifndef HVRL_COMMON__WINDOWS_HPP__
#define HVRL_COMMON__WINDOWS_HPP__

#ifdef WIN32
#include <windows.h>

void usleep(int waitTime) {
	__int64 time1 = 0, time2 = 0, sysFreq = 0;

	QueryPerformanceCounter((LARGE_INTEGER *)&time1);
	QueryPerformanceFrequency((LARGE_INTEGER *)&freq);
	do {
		QueryPerformanceCounter((LARGE_INTEGER *)&time2);
	}while( (time2-time1) <waitTime);
}
#endif

#endif
